package com.alipay.alipayDemo.service.impl;

import com.alipay.alipayDemo.config.AlipayUtil;
import com.alipay.api.AlipayApiException;
import com.alipay.alipayDemo.bean.AlipayBean;
import com.alipay.alipayDemo.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 功能描述: 支付服务
 *
 * @author lixiaoxiao
 * @date 2022/09/20 23:45
 * @since JDK 1.8
 */
@Service
public class PayServiceImpl implements PayService {
    @Autowired
    private AlipayUtil alipayUtil;

    @Override
    public String aliPay(AlipayBean alipayBean) throws AlipayApiException {
        return alipayUtil.alipay(alipayBean);
    }

    @Override
    public String rsaCheck(Map<String, String> params, String tradeStatus) {
        return alipayUtil.rsaCheck(params, tradeStatus);
    }

    @Override
    public String alipayRefound(AlipayBean alipayBean) throws AlipayApiException {
        return alipayUtil.alipayRefound(alipayBean);
    }

}
